home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / tool_inc.zip / LJUST.INC < prev    next >
Text File  |  1989-06-02  |  857b  |  38 lines

  1.  
  2. (*
  3.  * Copyright 1987, 1989 Samuel H. Smith;  All rights reserved
  4.  *
  5.  * This is a component of the ProDoor System.
  6.  * Do not distribute modified versions without my permission.
  7.  * Do not remove or alter this notice or any other copyright notice.
  8.  * If you use this in your own program you must distribute source code.
  9.  * Do not use any of this in a commercial product.
  10.  *
  11.  *)
  12.  
  13. (*
  14.  * ljust - macro for left justified strings in writeln format
  15.  *
  16.  *)
  17.  
  18. function ljust(s: string80; w: integer): string80;
  19. begin
  20.    if w > sizeof(s)-1 then
  21.       w := sizeof(s)-1;
  22.    repeat
  23.       s := s + ' ';
  24.    until length(s) >= w;
  25.  
  26.    ljust := copy(s,1,w);
  27. end;
  28.  
  29. function rjust(s: string80; w: integer): string80;
  30. begin
  31.    if w > sizeof(s)-1 then
  32.       w := sizeof(s)-1;
  33.    while length(s) < w do
  34.       s := ' ' + s;
  35.    rjust := s;
  36. end;
  37.  
  38.